#include <vector>
#include <iostream>

using namespace std;

class Solution 
{
public:
    vector<int> twoSum(vector<int> &numbers, int target) 
	{
        // Start typing your C/C++ solution below
        // DO NOT write int main() function
		if(numbers.size()<2)
			return vector<int>(2,0);

		vector<int> result(2,0);
		for(size_t i=1;i<numbers.size();i++)
		{
			for(size_t j=i+1;j<=numbers.size();j++)
			{
				if((numbers[i-1]+numbers[j-1])==target)
				{
					result[0] = i;
					result[1] = j;
					return result;
				}
			}
		}
    }
};


int main()
{
	int n,t;
	Solution s;
	while(cin>>n)
	{
		if(n<=0)
			break;
		cin>>t;
		vector<int> nums(n);
		for(int i=0;i<n;i++)
			cin>>nums[i];

		vector<int> r = s.twoSum(nums,t);
		cout<<r[0]<<" "<<r[1]<<endl;
	}
}